package com.xk.test;

import com.xk.user.pojo.User;
import com.xk.user.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.UnsupportedEncodingException;

@SpringBootTest
@RunWith(SpringRunner.class)
public class UserRegistDemo {
    /**
     * 用户注册测试
     */
    @Autowired
    private UserService userService;
    @Test
    public void run1() throws UnsupportedEncodingException {
        User user = new User();
        user.setUsername("张三");
        user.setPassword("123456");
        user.setPhone("13249788031");
        String code="555212";//手机中得到的验证码
        userService.register(user,code);



    }
}
